#import "DDXiaoHaoViewController.h"
@interface DDXiaoHaoViewController ()
@property (nonatomic, strong) DDTextField *nameTF;
@property (nonatomic, strong) DDButton *btn;
@end
@implementation DDXiaoHaoViewController
- (void)viewDidLoad {
    [super viewDidLoad];
}
- (DDTextField *)nameTF
{
    if (!_nameTF)
    {
        _nameTF = [[DDTextField alloc] init];
        _nameTF.type = JTWTextFieldTypeDefault;
        [self.view addSubview:_nameTF];
        _nameTF.c_top.equal(self.ddview.bar.c_bottom).with.coffset(GAP);
        _nameTF.c_left.equal(self.view).with.coffset(GAP);
        _nameTF.c_right.equal(self.view).with.coffset(-GAP);
        _nameTF.c_height.equal(TEXTFILDHEIGHT);
    }
    return _nameTF;
}
- (DDButton *)btn
{
    if (!_btn)
    {
        _btn = [[DDButton alloc] init];
        _btn.backgroundColor = helpermanger().getPara().color;
        _btn.layer.cornerRadius = GAP / 2.0;
        [_btn addTarget:self action:@selector(yjd_actionForBtnDid) forControlEvents:UIControlEventTouchUpInside];
        [self.view addSubview:_btn];
        _btn.c_top.equal(self.nameTF.c_bottom).with.coffset(GAP);
        _btn.c_left.equal(self.nameTF);
        _btn.c_right.equal(self.nameTF);
        _btn.c_height.equal(BUTTONHEIGHT);
    }
    return _btn;
}
- (void)yjd_actionForBtnDid
{
    DeLog(@"创建小号完成");
}
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    self.ddview.bar.title = @"创建新号";
    self.nameTF.placeholder = @"请输入小号名称，长度不能大于8位";
    self.btn.title = @"完成";
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

@end
